(function (window) {
  var u = {};
  var isAndroid = (/android/gi).test(navigator.appVersion);
  u.openUIInput = function (el, styles, autoFocus, placeholder, keyboardType, callback) {
    var search = document.querySelector(el);
    var rect = {
      x: $api.offset(search).l,
      y: $api.offset(search).t,
      w: $api.offset(search).w,
      h: $api.offset(search).h
    }
    console.log(JSON.stringify(rect));

    var UIInput = api.require('UIInput');
    UIInput.open({
      rect: rect,
      styles: styles,
      autoFocus: autoFocus,
      placeholder: placeholder,
      keyboardType: keyboardType,
    }, function (ret) {
      callback(ret, UIInput);
    });
  };
  window.$H5UiInput = u;
})(window);
